            <% content_for :sidebar do -%>
            <% if !current_user.nil? -%>
            <div class="side_box">
                <ul class="menu">
                <% if !current_user.nil? && current_user.community == @community -%>
                    <li><%= image_tag("page_white_add.png", :align=>"absmiddle")%> <%= link_to "新的实用信息", new_common_post_path(@community.district, @community) %></li>
                <% end -%>
                <% if !current_user.community.nil? -%>
                    <li><%= image_tag("add.png", :align=>"absmiddle")%> <%= link_to "添加场所", add_site_community_path(@community.district, @community) %></li>
                    <% if @community.can_edit?(current_user) -%>
                    <li><%= image_tag("edit.png", :align=>"absmiddle")%> <%= link_to "编辑社区资料", edit_community_path(@community.district, @community) %></li>
                    <% end -%>
                <% end -%>
                </ul>
            </div>
            <% end -%>
	    <div class="tab">
  		<h3>搜索位置</h3>
	    </div>
	    <div class="clear">
		<%= render :partial => "shared/searchCommunity" %>
	    </div>
            
            <% if @tags.size > 0 -%>
            <div class="tab">
  		<h3>热门标签</h3>
	    </div>
	    <div class="clear">
		<% tag_cloud @tags, %w(nube1 nube2 nube3 nube4 nube5) do |name, css_class| -%>
                    <span class="<%=css_class%>">
                    <%= link_to name, tag_path(name, :type => 'community', :type_id => @community) %>
                    </span>
                <% end -%>
	    </div>
            <% end -%>
            
            <% if @new_users.size > 0 -%>
            <div class="tab">
  		<h3>最新用户(<%= link_to "所有成员", users_community_path(@community.district, @community) %>)</h3>
	    </div>
	    <div class="clear">
                <%= render :partial => "shared/userlist", :object => @new_users %>                
	    </div>
            <% end -%>
            
            <% if @like_groups.size > 0 -%>
            <div class="tab">
  		<h3>这个社区的居民常去的小组</h3>
	    </div>
	    <div class="clear">
                    <%= render :partial => 'shared/grouplist', :object => @like_groups %>
	    </div>
            <% end -%>
             
            <% if  @community.actually_neighbors.size > 0 -%>
            <div class="tab">
  		<h3>邻近的社区</h3>
	    </div>
	    <div class="clear">
                <% for community in @community.actually_neighbors -%>
                    <%= link_to "#{community.title}", community_path(community.district, community)%><span class="postsubinfo">(<%= community.users.size%>个用户,<%= community.common_posts.size%>个帖子)</span><br/>
                <% end -%>
	    </div>
            <% end -%>
            
            
            <% if  @community.sites.size > 0 -%>
            <div class="tab">
  		<h3>邻近的场所</h3>
	    </div>
	    <div class="clear">
                <% for site in @community.sites -%>
                  <%= link_to "#{site.title}", site_path(site) %><span class="postsubinfo">[<%= site.site_category.title%>](<%= site.site_posts.size%>个评论,<%= site.votegood_count%>/<%= site.votegood_count + site.votebad_count%>的人觉得好)</span><br/>
                <% end -%>
	    </div>
            <% end -%>
            
            <br/>
            <script type="text/JavaScript"> 
              alimama_pid="mm_10195837_873999_1782343"; 
              alimama_titlecolor="FFFB88"; 
              alimama_descolor ="FFFFFF"; 
              alimama_bgcolor="FFFFFF"; 
              alimama_bordercolor="007D18"; 
              alimama_linkcolor="FFFB88"; 
              alimama_bottomcolor="FFFFFF"; 
              alimama_anglesize="10"; 
              alimama_bgpic="8"; 
              alimama_icon="1"; 
              alimama_sizecode="23"; 
              alimama_width=160; 
              alimama_height=600; 
              alimama_type=2; 
            </script> 
            <script src="http://a.alimama.cn/inf.js" type="text/javascript"> 
            </script>
                
	    <% end -%>
            
            <% content_for :navbar do -%>
            <div class="box">
                <img class="map" align="absmiddle" alt="You are here" src="/images/map.png"/>
                当前位置 
                » <%= link_to "您这儿", :controller =>'browse', :action => 'index' %> 
                » <%= link_to "#{@community.district.title}", district_path(@community.district) %>
                » <%= @community.title%>
                <b>
                <% if !current_user.nil? && !current_user.community.nil? && @community == current_user.community -%>
                    <strong>(我在这里住)</strong>
                <% else -%>
                    (
                    <% form_tag live_community_path(@community.district, @community) do -%>
                        <%= submit_tag '我在这里住！' %>
                    <% end -%>
                    )
                <% end -%>
                <% if !check_session_set_neighbor(@community) && !current_user.nil? && !current_user.community.nil? && @community != current_user.community && !@community.is_neighbor?(current_user.community) -%>
                    <%= image_tag("/images/loadingw.gif", :id => "loading-gif", :style => "display:none")%>
                    <span id="update_div">
                        (
                        <% form_remote_tag(:name => "set_neighbor", :update => "update_div", :url => set_neighbor_community_path(@community.district, @community), :loading => "Element.show('loading-gif'),Element.hide('update_div')",:complete => "Element.hide('loading-gif'),Element.show('update_div')") do -%>
                            <%= submit_tag "邻近社区" %>
                        <% end -%>
                        )
                    </span>
                <% end -%>
                </b>
            </div>
            <% end -%>
            <div class="box">
                <h3>
                    <%= feed_icon_tag @community.title, formatted_community_path(@community.district, @community, :rss) %> 社区最新热贴
                </h3>
                <ul class="tabs-nav">
                    <li class="active"><%= link_to "<span>社区</span>", community_path(@community.district, @community) %></li>
                    <li class=""><%= link_to "<span>场所</span>", sites_community_path(@community.district, @community) %></li>
                    <li class=""><%= link_to "<span>论坛</span>", forums_community_path(@community.district, @community) %></li>
                </ul>
                <%= render :partial=>'shared/posts', :object => @posts%>
            </div>


